//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.mass.core.activiti.workflow.utils;

import com.mass.core.activiti.workflow.utils.DateConverter;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.lang3.StringUtils;

public class Variable {
    private String keys;
    private String values;
    private String types;

    public Variable() {
    }

    public String getKeys() {
        return this.keys;
    }

    public void setKeys(String keys) {
        this.keys = keys;
    }

    public String getValues() {
        return this.values;
    }

    public void setValues(String values) {
        this.values = values;
    }

    public String getTypes() {
        return this.types;
    }

    public void setTypes(String types) {
        this.types = types;
    }

    @SuppressWarnings("unchecked")
	public Map<String, Object> getVariableMap() {
        @SuppressWarnings("rawtypes")
		HashMap vars = new HashMap();
        ConvertUtils.register(new DateConverter(), Date.class);
        if(StringUtils.isBlank(this.keys)) {
            return vars;
        } else {
            String[] arrayKey = this.keys.split(",");
            String[] arrayValue = this.values.split(",");
            String[] arrayType = this.types.split(",");

            for(int i = 0; i < arrayKey.length; ++i) {
                if(!"".equals(arrayKey[i]) && !"".equals(arrayValue[i]) && !"".equals(arrayType[i])) {
                    String key = arrayKey[i];
                    String value = arrayValue[i];
                    @SuppressWarnings("unused")
					String var10000 = arrayType[i];
                    vars.put(key, value);
                }
            }

            return vars;
        }
    }
}
